#ifndef HELPER_H
#define HELPER_H

#include "Stdafx.h"

#include <string>
#include <sstream>

std::string NetStringToString( System::String^ net_s );
std::string GetErrorText( bool bLst, unsigned long errcode = 0 );

#ifdef __cplusplus_cli
#pragma unmanaged
template<typename T>
std::string tostring( T obj )
{
	std::stringstream ss;
	ss << obj;
	return ss.str();
}
#pragma managed
#endif

#ifdef _DEBUG
#define Check(x) MessageBoxA(NULL, (tostring(__FUNCTION__) + " " + tostring(__LINE__) + " " + tostring(x)).c_str(), "Trace", MB_OK)
#else
#define Check(x)
#endif

#endif